package com.yang.booking.controller;

import com.yang.booking.service.AppointmentRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class AppointmentRuleController {

    @Autowired
    private AppointmentRuleService appointmentRuleService;

    @PostMapping("/provider/appointmentRule/insertAppointmentRule")
    public Map<String, Object> insertAppointmentRule(@RequestParam(name = "storeId") String storeId,
                                        @RequestParam(name = "earliestReserve") String earliestReserve,
                                        @RequestParam(name = "latestReserve") String latestReserve,
                                        @RequestParam(name = "latestCancel") String latestCancel,
                                        @RequestParam(name = "mostMeanwhile") String mostMeanwhile,
                                        @RequestParam(name = "mostTemporary") String mostTemporary
    ){
        return appointmentRuleService.insertAppointmentRule(storeId, earliestReserve, latestReserve, latestCancel, mostMeanwhile, mostTemporary);
    }
}
